<html>
	<head>
		<title>How It Works</title>
	</head>
	<body>
		<h3>How It Works</h3>
		<p>On the very left, under <b>particles_project</b>, double-click
		<b>main.py</b>.  You'll see a Particle class, which tells Python
		what data and functions we want each Particle object to have:
		</p>
		<ul>
			<li><p><tt>__init__</tt> is the constructor, which creates an object
			from a class.  We'll see how to call it below, in order to get
			a Particle object.</li>
			<li><p><tt>draw</tt> draws the particle onto the screen that you
			give it.</p></li>
			<li><p><tt>update</tt> moves the particle.</p></li>
		</ul>
		<p>Now, when we want a new particle, we call the Particle constructor.
		You can see an example on line 39.
		</p>
		<blockquote><tt>p = Particle(x, y, vx, vy)</tt></blockquote>
		<ul>
			<li>x and y indicate the particle's starting position.
			x is the number of pixels from the left side of the screen, and
			y is the number of pixels from the top.</li>
			<li>vx and vy indicate the particle's velocity.
			vx is the number of pixels <i>right</i> that the particle moves
			after each game frame.
			vy is the number of pixels <i>down</i> that the particle moves
			after each game frame.
			</li>
			<li>A new Particle object gets stored in p.</li>
		</ul>
		<p>
		There's also an example of a whole <i>list</i> of particles being
		created, on line 45.
		</p>
		<p>In the while loop on line 53, we clear the screen with the color
		white.  Then, we loop over each particle in the
		list.  We update and draw each particle <tt>p</tt> on the screen.
		Finally, we 'flip' the display to show what we just drew on the screen.
		click.tick(FRAMERATE) pauses the program for 1/FRAMERATE seconds,
		then we loop back to the top and do it all over again until you
		close the Pygame window.
		</p>
		<a href="index.html">Home</a>
	</body>
</html>
